package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 系统设置(t_base_settings)
 * </p>
 *
 * @author cnswhy
 * @since 2020-10-06
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_base_settings")
@ApiModel(value = "BaseSettings", description = "系统设置(t_base_settings)")
@AllArgsConstructor
public class BaseSettings extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 系统配置信息
     */
    @ApiModelProperty(value = "系统配置信息")

    @TableField("cfg_value")
    @Excel(name = "系统配置信息")
    private String cfgValue;

    /**
     * 业务设置标识
     */
    @ApiModelProperty(value = "业务设置标识")
    @Length(max = 255, message = "业务设置标识长度不能超过255")
    @TableField(value = "cfg_group", condition = LIKE)
    @Excel(name = "业务设置标识")
    private String cfgGroup;


    @Builder
    public BaseSettings(Long id, Long createUser, LocalDateTime createTime, Long updateUser, LocalDateTime updateTime,
                    String cfgValue, String cfgGroup) {
        this.id = id;
        this.createUser = createUser;
        this.createTime = createTime;
        this.updateUser = updateUser;
        this.updateTime = updateTime;
        this.cfgValue = cfgValue;
        this.cfgGroup = cfgGroup;
    }

}
